<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var str = "itbaizhan";
        console.log(str.length);
        console.log(str.charAt(5));
        //打印最后一个字符
        console.log(str.charAt(8));
        console.log(str.charAt(str.length - 1));

        console.log(str.charAt(-1));
        console.log(str.charAt(12));
        
        
        


    </script>
</body>
</html>